beginoutdoorscript;

variables;
short pcs,bmessage;

body;

beginstate 0;
break;

beginstate 1;
break;

beginstate START_STATE;

	if(get_flag(11,0) == 1){
		pcs = 4;
		while(pcs == 4){
			pcs = get_ran(1,0,3);
			if(char_ok(pcs) == FALSE)
				pcs = 4;
		}

		damage_char(pcs,get_ran(16,1,7),0);

//		pcs = 4;
//		while(pcs == 4){
//			pcs = get_ran(1,0,3);
//			if(char_ok(pcs) == FALSE)
//				pcs = 4;
//		}
		pcs = random_party_member();

		damage_char(pcs,get_ran(16,1,7),0);

		if(get_flag(14,0) == 0){
			if(party_size() == 1)
				message_dialog("Goddamn!  I'm hit, but there's no arrow!  Is this magic?  Whoever this sniper is, I'm in definite danger of my life while standing in range of it.","What's worse is, it doesn't look like I've got any way of reaching the sniper, considering how tall that cliff is.  But then, how did the sniper get up there?");
			if(party_size() > 1)
				message_dialog("Goddamn!  We're being hit, but there's no arrow!  Is this magic?  Whoever this sniper is, we're in definite danger of our lives while standing in range of it.","What's worse is, it doesn't look like we've got any way of reaching the sniper, considering how tall that cliff is.  But then, how did the sniper get up there?");
			set_flag(14,0,1);
		}
	}

break;

beginstate 10;

	if(get_flag(9,0) == 0){
		if(party_size() == 1)
			message_dialog("Up ahead, there's a bunch of brigands sitting on the road.  These must be part of the gang I was called here to beat up.","They haven't noticed me yet, but there's no real way to get around them.  Not only are they at a bottleneck, there's also a fair deal of them.  If I want to get down this road, I'll have to get down and dirty with them.");
		if(party_size() > 1)
			message_dialog("Up ahead, there's a bunch of brigands sitting on the road.  These must be part of the gang we were called here to beat up.","They haven't noticed us yet, but there's no real way to get around them.  Not only are they at a bottleneck, there's also a fair deal of them.  If we want to get down this road, we'll have to get down and dirty with them.");
		set_flag(9,0,1);
	}

break;

beginstate 11;

	if(get_flag(9,0) < 2){
		message_dialog("It looks as if the brigands tore this wall up completely.  It couldn't have been overwhelmingly powerful, but it would have been a nice position to defend, assuming that Sunset Creek wouldn't actually be attacked from the inside.","There's nobody left here and nothing that isn't bolted to the ground.  It's a fairly dismal sight.");
		set_flag(9,0,2);
	}

break;

beginstate 12;

	if(get_flag(11,0) == 0)
		set_flag(11,0,1);

	if(get_flag(12,0) == 0){
		message_dialog("Is that a campsite up in the distance?  If so, why is it perched on that ledge?  The only person who would want to go there is...","Oh no.  A sniper.");
		set_flag(12,0,1);
	}

break;

beginstate 13;

	if(get_flag(11,0) == 1)
		set_flag(11,0,0);

break;

beginstate 14;

	if(get_flag(11,0) == 1){
//		pcs = 4;
//		while(pcs == 4){
//			pcs = get_ran(1,0,3);
//			if(char_ok(pcs) == FALSE)
//				pcs = 4;
//		}
		pcs = random_party_member();

		damage_char(pcs,get_ran(100,1,5),4);

		block_entry(1);
	}

break;

beginstate 15;

	if((get_flag(13,0) == 0) && (get_flag(11,0) == 1)){
		if(party_size() == 1)
			message_dialog("Okay.  There's a sniper essentially raining hell down on me...  Think this over for a second- would it be a good or bad decision to get close enough that he's literally shooting arrows down my throat?","");
		if(party_size() > 1)
			message_dialog("Okay.  There's a sniper essentially raining hell down on us...  Think this over for a second- would it be a good or bad decision to get close enough that he's literally shooting arrows down our throats?","");
		set_flag(13,0,1);
	}

break;

beginstate 16;

	if(get_flag(11,0) == 1)
		set_flag(11,0,0);
	if(get_flag(15,0) == 0){
		message_dialog("So...  The sniper used this small crevasse in the mountain wall to slip into this rather wide and spacious spiraling pathway.","Time to track this bastard down.  He'll be getting a good taste of steel imminently.");
		set_flag(15,0,1);
	}

break;

beginstate 17;

	if(get_flag(15,0) == 1){
		message_dialog("That's strange...  He's probably capable of shooting at me from this angle if he can fire at me from way up atop the cliff, but he's not.","");
		set_flag(15,0,2);
	}

break;

beginstate 18;

	reset_dialog();
	if(party_size() == 1)
		add_dialog_str(0,"If I wanted to leave, well...  The way's open right here.",0);
	if(party_size() > 1)
		add_dialog_str(0,"If we wanted to leave, well...  The way's open right here.",0);
	add_dialog_choice(0,"Stay.");
	add_dialog_choice(1,"Leave.");
	bmessage = run_dialog(0);
	block_entry(1);
	if(bmessage == 1)
		end();

	reset_dialog();
	if(party_size() == 1)
		add_dialog_str(0,"Man, am I glad to not have to deal with that mess.",0);
	if(party_size() > 1)
		add_dialog_str(0,"Man, are we glad to not have to deal with that mess.",0);
	add_dialog_str(1,"----",40);
	add_dialog_str(2,"One month after leaving, word begins to spread that there has been a powerful, invading army in Sunset Creek, that the city has fallen, and that outlying provinces in the area have begun to fall.",0);
	add_dialog_str(3,"The Imperial Red Army, formed and headed by the recently-appointed General Field Marshall Rufus Rothgard, is created to counter all threats on the Imperial frontiers, and has absorbed all of the growing military on Valorim.",0);
	add_dialog_str(4,"The brigand army is eventually countered and destroyed, and the new _Red Army_ is celebrated across Valorim for its efforts.",0);
	add_dialog_str(5,"Of course, all of this wasn't really necessary, but hey-- that's life.",0);
	bmessage = run_dialog(1);

	pcs = 0;
	while(pcs <= 3){
		if(char_ok(pcs) == TRUE){
			change_spell_level(pcs,1,15,get_flag(30,(pcs + 5)));
		}

		pcs = (pcs + 1);
	}
	end_scenario(0);

break;

beginstate 30;

	reset_dialog();
	if(party_size() == 1){
		add_dialog_str(0,"The camp of brigands here sees me.  There's just no getting around it.  But why are they milling around?",0);
		add_dialog_str(1,"They're taking a good look at me, and now...  HEY!  They're fleeing?!  What gives?",0);
	}
	if(party_size() > 1){
		add_dialog_str(0,"The camp of brigands here sees us.  There's just no getting around it.  But why are they milling around?",0);
		add_dialog_str(1,"They're taking a good look at us, and now...  HEY!  They're fleeing?!  What gives?",0);
	}
	add_dialog_choice(0,"Let them go.");
	add_dialog_choice(1,"Chase them.");
	bmessage = run_dialog(1);
	if(bmessage == 1){
		outdoor_enc_result(3);
		end();
	}
	pcs = 0;
	while(pcs <= 3){
		if(char_ok(pcs) == TRUE){
			if((get_stat(pcs,1) < 8) && (in_horse() == -1)){
				pcs = 4;
				if(party_size() == 1)
					message_dialog("It's no use.  I'm just not fast enough to keep up with the brigands.  But why would they be so eager just to defeat me?","");
				if(party_size() > 1)
					message_dialog("It's no use.  We're just not fast enough to keep up with the brigands.  But why would they be so eager just to defeat us?","");
				outdoor_enc_result(3);
				end();
			}
		}

		pcs = (pcs + 1);
	}
	if(party_size() == 1)
		message_dialog("The brigands are beginning to realize that I'm not really slowing down...  Suddenly, some of them stop in their tracks.","It's a rather transparent distraction technique:  A few of them are stopping so that the rest of them can escape.  It's a remarkably selfless tactic for brigands to use.");
	if(party_size() > 1)
		message_dialog("The brigands are beginning to realize that we're not really slowing down...  Suddenly, some of them stop in their tracks.","It's a rather transparent distraction technique:  A few of them are stopping so that the rest of them can escape.  It's a remarkably selfless tactic for brigands to use.");

break;

